//==============================================================================
#ifndef _SEVERRECEIVER_H_
#define _SEVERRECEIVER_H_

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif

#pragma once
#include "GameServer.h"
#include "concurrent\Runnable.h"

using namespace concurrent;

class GameServer;

//==============================================================================
class ServerReceiver : public Runnable
{
public:
	ServerReceiver(GameServer* server);
	virtual ~ServerReceiver(void);

	void setServer(GameServer* server);
	GameServer* getServer(void);
	void setIsReceiving(bool flag);
	bool isReceiving(void);

	int startReceiving(void);
	void stopReceiving(void);

protected:
	virtual DWORD run(void);
private:
	GameServer* server;
	bool _isReceiving;
};
#endif
